UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dixH3sz6xd9UThWGNGC/qeoCoX2eR80JLFqgQYvC4kw='
WHERE
key_id = 'fb511cde358508d2a2345e6a220c2775732de316beb3c544dd112ed26864e388'
AND (
token = 'dixH3sz6xd9UThWGNGC/qeoCoX2eR80JLFqgQYvC4kw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)