UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qj7HBb/k2BnJlLh5GN00FXbVId6e/RDVLBC11SsToeE=' 
WHERE 
  key_id = '6d2abd5f0d79037acb7c52756ed3107f5b6efe75fa153d5b743e2b7c0504e085' 
  AND (
    token = 'qj7HBb/k2BnJlLh5GN00FXbVId6e/RDVLBC11SsToeE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029