UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BUFFHefkfnyUJLaKhsR29WeizlUaaYlQN2Ka/v+dUeE='
WHERE
key_id = 'ea573a3416be7dfec22bcfeb657b3a56a8ca6f9faa282384474e816d82a8099c'
AND (
token = 'BUFFHefkfnyUJLaKhsR29WeizlUaaYlQN2Ka/v+dUeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)