UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cQQBE3Zwt+l+A7giP14KL6rMbsHMPEhoxUABhJdVMYc='
WHERE
key_id = '0ee8a29aef9d05c9d7f463a53fc213318874b3d4db198c9c339a51dcc9d64da7'
AND (
token = 'cQQBE3Zwt+l+A7giP14KL6rMbsHMPEhoxUABhJdVMYc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)