UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'viXWzXxqTn8l7DW4gnhG5zCXSOnCZjVT3Vm0PrIQxns='
WHERE
key_id = '571cd17dd4d5e5a0e792b487f005ba36b0e7dd798a0db48999686ccbb0078566'
AND (
token = 'viXWzXxqTn8l7DW4gnhG5zCXSOnCZjVT3Vm0PrIQxns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)