UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6q7X+Nzl2rbItZSVZO9pqJf+6xODa8iFzuDaMZauFyU='
WHERE
key_id = 'cbfcd5ddd329ca43e6fe033126d84942a13e5d693bfb294b1f4382a41adc7380'
AND (
token = '6q7X+Nzl2rbItZSVZO9pqJf+6xODa8iFzuDaMZauFyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)