UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yBvcfFUuX78+bQVRHOdFIMzc6JrwiPHCt3P+tx4qsD8='
WHERE
key_id = '998ca4e572dfbe28d339d6cabd0d152ec55d308596cb709a924e153bd8df27f3'
AND (
token = 'yBvcfFUuX78+bQVRHOdFIMzc6JrwiPHCt3P+tx4qsD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)