UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZzbySR98J4lgj8MZpR2Aal74fHA/BmD+qHnBpG7Qhv4=' 
WHERE 
  key_id = '57e7cd82c1b206baa2138665521abed7e548d0f537e6871595299bb91ce8c87e' 
  AND (
    token = 'ZzbySR98J4lgj8MZpR2Aal74fHA/BmD+qHnBpG7Qhv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027