UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sMiBG71Gu9+WqrouQkMqC2O6K/iis9s4MnT0I1gteos='
WHERE
key_id = 'c2b494579c48d580bb1c020111d1f9248cdbdeb7cfe3d4eda2667830aaeb9f44'
AND (
token = 'sMiBG71Gu9+WqrouQkMqC2O6K/iis9s4MnT0I1gteos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)