UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nKN8U2OrAQzvbAPEQy6P4cYqnbbBPEAEFJN3sr+WhTs='
WHERE
key_id = '5ed38dcf24ee29ef3818d7deae784fef5c016f5537019dc3f7dddf1cdd940a8e'
AND (
token = 'nKN8U2OrAQzvbAPEQy6P4cYqnbbBPEAEFJN3sr+WhTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)