UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mJmS1bBVnfKSGhu3MJeQVxIea5Uu1YP+mVfbwsrx8/g='
WHERE
key_id = '3c881aeb4a59c451cee9c3f1c1b7e72547717f481bdf123bb46113b41e959786'
AND (
token = 'mJmS1bBVnfKSGhu3MJeQVxIea5Uu1YP+mVfbwsrx8/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)