UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fp00CM9l+N5RKC7TPHgTZkXNoWoEc4HuroZ0DOl1qYY='
WHERE
key_id = 'b4d91e15cc564429bdb233ac5b93adeea61522758947a284d413180dac3d31d6'
AND (
token = 'Fp00CM9l+N5RKC7TPHgTZkXNoWoEc4HuroZ0DOl1qYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)