UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nGHoqQ1lqBr98oHT7zu/cVz+rEusnlrU8dwOC+z/Ke0=' 
WHERE 
  key_id = '41176a283e85c7fc78ec12f63eee2fa2b98c01592a5c511793169a0673cc84a8' 
  AND (
    token = 'nGHoqQ1lqBr98oHT7zu/cVz+rEusnlrU8dwOC+z/Ke0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036