UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nouPTWqpDMUvIIdb4oRvQE/+7obZ+A88zGK6DbviIkw='
WHERE
key_id = '6bb3cccaf1e896fbf30c019c03ca1c42dbf719abc17f7ebb9f384fea9d26d7f8'
AND (
token = 'nouPTWqpDMUvIIdb4oRvQE/+7obZ+A88zGK6DbviIkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)