UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '324IGkY6+LZX37VLIe8caKceqicM/BHyhtjzhjcCD/U='
WHERE
key_id = '7f7f64ab05d9dba3fde565503827ef19f334ef8662bddace0f4f3856ee2aa3ea'
AND (
token = '324IGkY6+LZX37VLIe8caKceqicM/BHyhtjzhjcCD/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)