UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k3Y7I/u3ZImN34+WfCFbfkorbR6zOpIL0Q7Bzl5WL7E='
WHERE
key_id = 'a569ac58aac4e0764e4438c2e761bc924021e93265df87359a61d76f8a29a5a5'
AND (
token = 'k3Y7I/u3ZImN34+WfCFbfkorbR6zOpIL0Q7Bzl5WL7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)