UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pfZsE/bbCpJ/UF5W3S4QST1WGuItwjF4/xBsqFpnFkY='
WHERE
key_id = '124424cd10c62e670463ab3b9d8647adeadfc41354fcdbd05988789028c51ebb'
AND (
token = 'pfZsE/bbCpJ/UF5W3S4QST1WGuItwjF4/xBsqFpnFkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)