UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+CHt6drFFbWBbcq2ZxqFg6Lrn12gRpa3EWX+7E/QyeY='
WHERE
key_id = '71dd21ccf66ebbcf6e497ca91ccd6c97ed61e19efed317b9798b9bcc304496ab'
AND (
token = '+CHt6drFFbWBbcq2ZxqFg6Lrn12gRpa3EWX+7E/QyeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)