UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnGAfFbSZrE57K+RFV+DQP3hJtiYv8ZjJpwJZbOZU1w='
WHERE
key_id = 'f8b4ef5167e2a626d09cb14ea683f0c709d2c33e3dd56a7567cfbe8a7dd9d36e'
AND (
token = 'HnGAfFbSZrE57K+RFV+DQP3hJtiYv8ZjJpwJZbOZU1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)