UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ytj85hVO5k1wJW/2TswjT3MS6pWiCDWmR/wrMFmnLRo=' 
WHERE 
  key_id = '053946fb9900dce9cc092915a9fdc8a067117e8d81b165b4fd0d0e80dbf182dd' 
  AND (
    token = 'ytj85hVO5k1wJW/2TswjT3MS6pWiCDWmR/wrMFmnLRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028