UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QNb9yJ/AWvsijQdqCnRD9yF1/Im//GxkSO+EeMjByGA='
WHERE
key_id = '3e1b5e4c6cfc674b0d7a7bc57d1d2e746e51abcbd7e5a7e0c9ad7ec2fe407603'
AND (
token = 'QNb9yJ/AWvsijQdqCnRD9yF1/Im//GxkSO+EeMjByGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)