UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'odtHxrDu/fhXW4zNR+LA3AJ5aWLiFjdHDQ2bqN7UgX0='
WHERE
key_id = '022908601007d3fdbd805435f8667216f8c4cd71042c235943c330f9b0f50c8e'
AND (
token = 'odtHxrDu/fhXW4zNR+LA3AJ5aWLiFjdHDQ2bqN7UgX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)