UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B+ud4nOJhsp6w73hNGL4n5Ts6o9L1JkTnpwUyUoFXOY='
WHERE
key_id = '175599dd8b8e96746f156e089c8373ffc82996e6b652f3cda3c5839b7b5be4ea'
AND (
token = 'B+ud4nOJhsp6w73hNGL4n5Ts6o9L1JkTnpwUyUoFXOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)