UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bKTlxdqyHa4hqc3WNjmaDIaf1W7pL3Zes4nr3tRfFPI=' 
WHERE 
  key_id = '4a45f99ab6272ae4b78b51b322606cbb815d124b28f2a6cfdcd3da857d44b8c3' 
  AND (
    token = 'bKTlxdqyHa4hqc3WNjmaDIaf1W7pL3Zes4nr3tRfFPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028