UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5nyOt7FV/vsaA43uthn/466TfDUfq0jd6HPDkgg0Fd4='
WHERE
key_id = '27e50a85e3f8c9f37733daa1e384b0c76d1e60cb98c7be1635a23cc452747ccc'
AND (
token = '5nyOt7FV/vsaA43uthn/466TfDUfq0jd6HPDkgg0Fd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)