UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CHFStqBhJ1kuinHsE1aVUzXWCLKj+bEhgpVoHngEyXI=' 
WHERE 
  key_id = '436832d6a47d44ce4229fc84dc65a1c5abe70ee3a5beb4eeda1810468c767bb8' 
  AND (
    token = 'CHFStqBhJ1kuinHsE1aVUzXWCLKj+bEhgpVoHngEyXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026