UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8drjraCz3tSG3y36SN8ado4/+h78BdiLXVPhKIvQ6w0='
WHERE
key_id = '5f059169c49ade8a3fdd3b46b112e98197c9b147cb317427cec95ff4681a956b'
AND (
token = '8drjraCz3tSG3y36SN8ado4/+h78BdiLXVPhKIvQ6w0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)