UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6MPBTRpBQxV0K/TCs376dC+m8jpJu/5DfCwyZl2CxE0='
WHERE
key_id = 'b85b46d5a9eee4961e29c47e1ffd156edd186e877b0e039eb26c88336522c6dd'
AND (
token = '6MPBTRpBQxV0K/TCs376dC+m8jpJu/5DfCwyZl2CxE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)