UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9yVCjncdk17xce2fO/Hq0wsu00wH5eDd/xjmk1dopmY=' 
WHERE 
  key_id = '479b7da1cb65861ae33fb9ad72267768167130654af3802384a8f3670494d8e5' 
  AND (
    token = '9yVCjncdk17xce2fO/Hq0wsu00wH5eDd/xjmk1dopmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024