UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vRyJI2TfXSy7K5JTa60YE+GtNb4vsuwzRKWi5S6rnPQ='
WHERE
key_id = '42998bf063eac662d5fe65378ce28c8c5edb9d89ca5f5c8ebd723ed6698b2d67'
AND (
token = 'vRyJI2TfXSy7K5JTa60YE+GtNb4vsuwzRKWi5S6rnPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)