UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JEn56PDapGiO1l8A1x3XAhI9PTYZ4ITnCGMdSOYHgyk='
WHERE
key_id = '7bb44e83cc36adc3acd9a4fc1af4dad363b59af9d9f961542587f0a074f1bc76'
AND (
token = 'JEn56PDapGiO1l8A1x3XAhI9PTYZ4ITnCGMdSOYHgyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)