UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nfo7cfMlqsT5ZzFAcl+ymQ3kt+HrJF6g4dwpaZFeyFA='
WHERE
key_id = '0a8e10805b1dd81539ce7620b208385cedfca0069066c943ffa0558b5e4c9ef8'
AND (
token = 'nfo7cfMlqsT5ZzFAcl+ymQ3kt+HrJF6g4dwpaZFeyFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)