UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dqhVTl8Flt7tmU3U+2MSuJUmbqSTOPOxnxyUVb2BSGg='
WHERE
key_id = '33865b307daeaf6013d95c53e172c245f50fd5a9846fab1a77f35150ec73a4a5'
AND (
token = 'dqhVTl8Flt7tmU3U+2MSuJUmbqSTOPOxnxyUVb2BSGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)