UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mzbwuMj3dqERED20BA6vIGR84wUyFMa/jLSMcEs1c8k='
WHERE
key_id = 'ac708263ec970d57742512b940706d7b7492cb9d27050eba851f3c8410c0a2e1'
AND (
token = 'mzbwuMj3dqERED20BA6vIGR84wUyFMa/jLSMcEs1c8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)