UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j1fDHLoj17GcctGV3Oi+ymsbWvxHNMj8GPVpSLg3Li4=' 
WHERE 
  key_id = '880cde463502dc5e4a9148ac085578af8981ed99d4e84398916998f7633115c5' 
  AND (
    token = 'j1fDHLoj17GcctGV3Oi+ymsbWvxHNMj8GPVpSLg3Li4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016