UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mbSic0RLB9B8psMwdBaMEeZYan/Y9t/4MPS3xuOg67w='
WHERE
key_id = '49c08ead6e537592a933994723f96db7157045c5b74909ecd6eea7535531199c'
AND (
token = 'mbSic0RLB9B8psMwdBaMEeZYan/Y9t/4MPS3xuOg67w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)