UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2YwDoQf6t1G35GxVXKuva0QM1nf8hvtH/OvyZcLgvoU=' 
WHERE 
  key_id = 'd687a1f84ca1c9578df00208af3413461c6a51b1ddf2ae0a77551aa42cd0c565' 
  AND (
    token = '2YwDoQf6t1G35GxVXKuva0QM1nf8hvtH/OvyZcLgvoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018