UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UfH980Va2tsNZekPAxNZeA19JDBZcCFt2aC8flz5ND0='
WHERE
key_id = '6910a56d96cd0acc6cbdf210e207f2991fd0087070e6ccbf1d4f9b32fe26ee48'
AND (
token = 'UfH980Va2tsNZekPAxNZeA19JDBZcCFt2aC8flz5ND0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)