UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1m/3TUK+0IZGwuW1dCcwQiLqiDo07Uw4ILSNmKwuJPI=' 
WHERE 
  key_id = '9ebcf344f99e5cfc87ad39f9f0ace9faf60a57917688d35f188675b41c502351' 
  AND (
    token = '1m/3TUK+0IZGwuW1dCcwQiLqiDo07Uw4ILSNmKwuJPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019